home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Comms Spectacular / AppleTalk Remote Access / GV Variable CCLs folder / GV PP⁄G&S Vary / GV PP_G&S Vary
Encoding:
Text File  |  1993-10-29  |  6.9 KB  |  362 lines

  1. !
  2. ! AppleTalk Remote Access Script
  3. ! For use with Global Village PowerPort/GOLD /SILVER
  4. !
  5. ! 6/21/92  AN   Added "pause 30" right after @LABEL 30 to fix a problem
  6. !               with the PowerBook hanging when AUTO_ANSWER was selected.
  7. !               Also changed all &F strings to &F&C1&D1.
  8. ! 6/13/92  AN   Always save &C1&D1 to NVRAM in Bronze
  9. !          AN   Fixed bug where PowerPort/Bronze was not being recognized
  10. ! 6/06/92  LAL  ORIGINAL RELEASE
  11. ! 12/1/92 CTC  Split scripts into a HighSpeed and a LowSpeed script
  12. ! 02/15/93SAP  Included changes for MA's and changed ati0 to ati1
  13. ! 10/27/93 PMT Added user selection of maximum speed
  14. !
  15. @ORIGINATE
  16. @ANSWER
  17. !
  18. ! Talk to the modem at 2400 bps.
  19. !
  20. serreset 2400, 0, 8, 1
  21. !
  22. ! First recall the factory configuration
  23. !
  24. settries 0
  25. matchclr
  26. @LABEL 1
  27. matchstr 1 3 "OK\13\10"
  28. write "AT&F&C1\13"
  29. matchread 30
  30. inctries
  31. iftries 2 59
  32. jump 1
  33. !
  34. ! Which PowerPort is in use?  High Speed (246) or Low Speed (192)?
  35. !
  36. @LABEL 3
  37. Flush
  38. pause 10
  39. Note "Checking modem type..." 2
  40. matchclr
  41. matchstr 1 68 "192\13\10\13\10"
  42. matchstr 2  4 "163\13\10\13\10"
  43. matchstr 3  4 "004\13\10\13\10"
  44. matchstr 4  4 "246\13\10\13\10"
  45. matchstr 5  4 "066\13\10\13\10"
  46. write "ATI1\13"
  47. matchread 60
  48. note "Not a Global Village PowerPort." 2
  49. jump 59
  50. !
  51. ! PowerPort Silver or Gold Continues Here
  52. !
  53. settries 0
  54. @LABEL 4
  55. note "Initializing GVC PowerPort High-Speed..." 2
  56. !
  57. ! Talk to the modem at 19,200 bps.  
  58. !
  59. serreset 19200, 0, 8, 1
  60. !
  61. ! &f   - recall factory settings
  62. ! \q3  - Use RTS/CTS flow control in full-duplex mode
  63. ! \k0  - Enter command state but do not send break
  64. ! \j0  - Disable port rate adjust
  65. ! S0=0 - Don't answer calls
  66. ! E1   - Turn command echo on
  67. ! \n5  - enable v.42LAPM autoreliable
  68. ! %c0  - turn off MNP5 compression
  69. !
  70. HSReset 0 1 0 0 0 1
  71. settries 0
  72. matchclr
  73. @LABEL 5
  74. matchstr 1 6 "OK\13\10"
  75. write "AT&f\\k0\\j0\\q3e1s0=0\n5%c0\13"
  76. matchread 50
  77. inctries
  78. iftries 2 59
  79. jump 5
  80. !
  81. ! If speaker on flag is true, jump to label 8.  Else turn off the speaker
  82. !
  83. @LABEL 6
  84. !
  85. ! Next step is to determine the modem speed required.
  86. ! This step is some what compliacted as access to the 
  87. ! inputed string directly is seemingly imposible.
  88. ! The current solution is to write the string to the modem
  89. ! whilst it is still in echo mode and then use matchstr to
  90. ! compare it to the expected values
  91. !
  92. ifANSWER 90
  93. ! if originating call ask user for max speed
  94. ask 0 "Communications Speed (14400,12000,9600,7200,4800,2400,1200,300)"
  95.  
  96. ! Put modem into echo mode
  97. matchstr 1 80 "OK\13\10"
  98. write "ATE1\13"
  99. matchread 30
  100. jump 59
  101.  
  102. @LABEL 80
  103. write "^*\13"
  104. matchstr 1 81 "14400\13"
  105. matchstr 2 82 "12000\13"
  106. matchstr 3 83 "9600\13"
  107. matchstr 4 84 "7200\13"
  108. matchstr 5 85 "4800\13"
  109. matchstr 6 86 "2400\13"
  110. matchstr 7 87 "1200\13"
  111. matchstr 8 88 "300\13"
  112. matchread 30
  113. jump 6
  114.  
  115. @LABEL 81
  116. note "Maximum Speed 14400"
  117. write "AT%b14400\13"
  118. jump 89
  119.  
  120. @LABEL 82
  121. note "Maximum Speed 12000"
  122. write "AT%b12000\13"
  123. jump 89
  124.  
  125. @LABEL 83
  126. note "Maximum Speed 9600"
  127. write "AT%b9600\13"
  128. jump 89
  129.  
  130. @LABEL 84
  131. note "Maximum Speed 7200"
  132. write "AT%b7200\13"
  133. jump 89
  134.  
  135. @LABEL 85
  136. note "Maximum Speed 4800"
  137. write "AT%b4800\13"
  138. jump 89
  139.  
  140. @LABEL 86
  141. note "Maximum Speed 2400"
  142. write "AT%b2400\13"
  143. jump 89
  144.  
  145. @LABEL 87
  146. note "Maximum Speed 1200"
  147. write "AT%b1200\13"
  148. jump 89
  149.  
  150. @LABEL 88
  151. note "Maximum Speed 300"
  152. write "AT%b300\13"
  153. jump 89
  154.  
  155. @LABEL 89
  156. matchclr
  157. matchstr 1 90 "OK\13\10"
  158. matchread 30
  159. jump 89
  160.  
  161. @LABEL 90
  162. ! Clear all match strings to leave in the state we arrived
  163. matchclr
  164. matchstr 1 92 "OK\13\10"
  165. write "ATE0\13"
  166. @LABEL 91
  167. matchread 30
  168. jump 91
  169.  
  170. @LABEL 92
  171. matchclr
  172. ifstr 2 8 "1"
  173. pause 5
  174. matchstr 1 8 "OK\13\10"
  175. write "ATM0\13"
  176. matchread 30
  177. jump 59
  178. !
  179. ! The modem is ready so enable answering, or originate a call
  180. !
  181. @LABEL 8
  182. pause 5
  183. ifANSWER 30
  184. note "Dialing ^1" 3
  185. write "ATDT^1\13"
  186. !
  187. @LABEL 9
  188. matchstr 1  11 "CONNECT 1200\13\10"
  189. matchstr 2  12 "CONNECT 2400\13\10"
  190. matchstr 3  13 "CONNECT 4800\13\10"
  191. matchstr 4  19 "CONNECT 7200\13\10"
  192. matchstr 5  14 "CONNECT 9600\13\10"
  193. matchstr 6  20 "CONNECT 12000\13\10"
  194. matchstr 7  18 "CONNECT 14400\13\10"
  195. matchstr 8  50 "NO CARRIER\13\10"
  196. matchstr 9  50 "ERROR\13\10"
  197. matchstr 10 52 "NO DIAL TONE\13\10"
  198. matchstr 11 53 "BUSY\13\10"
  199. matchstr 12 54 "NO ANSWER\13\10"
  200. matchread 700
  201. jump 59
  202. !
  203. ! Notice that all we do for different connect speeds is issue a 
  204. ! "CommunicatingAt" command.  Remember, we locked the interface speed
  205. ! to 19,200 bps so we don't want to reset the serial speed after we connect.
  206. ! CommunicatingAt tells ARA what the actual line speed is so that it
  207. ! can set it's timers appropriately.  I guess your performance would be
  208. ! sub-optimal if you don't set this...
  209. !
  210. @LABEL 11
  211. note "Communicating at 1200 bps." 2
  212. CommunicatingAt 1200
  213. jump 15
  214. !
  215. @LABEL 12
  216. note "Communicating at 2400 bps." 2
  217. CommunicatingAt 2400
  218. jump 15
  219. !
  220. @LABEL 13
  221. note "Communicating at 4800 bps." 2
  222. CommunicatingAt 4800
  223. jump 15
  224. !
  225. @LABEL 19
  226. note "Communicating at 7200 bps." 2
  227. CommunicatingAt 7200
  228. jump 15
  229. !
  230. @LABEL 14
  231. note "Communicating at 9600 bps." 2
  232. CommunicatingAt 9600
  233. jump 15
  234. !
  235. @LABEL 20
  236. note "Communicating at 12000 bps." 2
  237. CommunicatingAt 12000
  238. jump 15
  239. !
  240. @LABEL 18
  241. note "Communicating at 14400 bps." 2
  242. CommunicatingAt 14400
  243. jump 15
  244. !
  245. ! Set CTS handshaking ON in the serial port (that's the 1 in the HSReset
  246. ! command below )
  247. !
  248. @LABEL 15
  249. HSReset 0 1 0 0 0 1 
  250. ifANSWER 16
  251. pause 30
  252. @LABEL 16
  253. exit 0
  254. !
  255. ! @ANSWER
  256. ! Set up the modem to answer
  257. !
  258. @LABEL 30
  259. write "ATS0=1\13"
  260. matchstr 1 31 "OK\13\10"
  261. matchread 30
  262. jump 59
  263. !
  264. @LABEL 31
  265. matchstr 1  32 "RING\13\10"
  266. matchstr 2  11 "CONNECT 1200\13\10"
  267. matchstr 3  12 "CONNECT 2400\13\10"
  268. matchstr 4  13 "CONNECT 4800\13\10"
  269. matchstr 5  19 "CONNECT 7200\13\10"
  270. matchstr 6  14 "CONNECT 9600\13\10"
  271. matchstr 7  20 "CONNECT 12000\13\10"
  272. matchstr 8  18 "CONNECT 14400\13\10"
  273. matchstr 9  50 "NO CARRIER\13\10"
  274. matchstr 10 50 "ERROR\13\10"
  275. matchstr 11 52 "NO DIAL TONE\13\10"
  276. matchstr 12 53 "BUSY\13\10"
  277. matchstr 13 54 "NO ANSWER\13\10"
  278. matchread 700
  279. jump 31
  280. !
  281. @LABEL 32
  282. userhook 1
  283. note "Answering phone..." 2
  284. jump 31
  285. !
  286. ! 50: error messages
  287. !
  288. @LABEL 50
  289. exit -6021
  290. !
  291. @LABEL 52
  292. exit -6020
  293. !
  294. @LABEL 53
  295. exit -6022
  296. !
  297. @LABEL 54
  298. exit -6023
  299. !
  300. @LABEL 59
  301. exit -6019
  302. !
  303. ! Hang up the modem
  304. !
  305. @HANGUP
  306. @LABEL 60
  307. settries 0
  308. serreset 19200, 0, 8, 1
  309. HSReset 0 1 0 0 0 1
  310. @LABEL 61
  311. !
  312. SBreak
  313. pause 20
  314. Flush               ! prevent disconnect garbage
  315. write "\13"         ! start on a clean line
  316. @LABEL 96
  317. matchclr
  318. matchstr 1 97 "OK\13\10"
  319. write "AT\13"
  320. matchread 30
  321. inctries
  322. iftries 3 59
  323. jump 96
  324. @LABEL 97
  325. settries 0
  326. @LABEL 98
  327. matchclr
  328. matchstr 1 62 "OK\13\10"
  329. matchstr 2 62 "NO CARRIER\13\10"
  330. write "ATH\13"
  331. matchread 100
  332. inctries
  333. iftries 3 59
  334. jump 98
  335. @LABEL 62
  336. settries 0
  337. !
  338. ! recall the factory settings. (see note at top of script)
  339. !
  340. @LABEL 63
  341. matchclr
  342. matchstr 1 65 "OK\13\10"
  343. pause 15
  344. write "AT&f&C1\\V2w1\\k0\\j0\\q3e0s0=0\n5%c0\13"
  345. matchread 50
  346. inctries
  347. iftries 3 59
  348. jump 63
  349. !
  350. @LABEL 65
  351. exit 0
  352. !
  353. !
  354. !
  355. ! ------------------- POWERPORT/BRONZE -------------------
  356. !
  357. ! The user is attempting to run the High speed script on a Bronze, notify
  358. ! the user, log the msg and exit with "Modem not responding" error.
  359. !
  360. @LABEL 68
  361. note "Incorrect script file, please use GVC PowerPort/Bronze”" 3
  362. jump 59